<?php
/**
 * 字段有:
 * 	id
 * 	
 */
//对{prod } ... {/prod }的解析
function smarty_block_prod (&$params, $content, &$smarty, &$repeat){
   return $smarty->callblockfunc($params,$content,$smarty,$repeat, getprod);
}

/**
 * 参数：
 * 	
 * @param unknown_type $params
 */
function getprod(&$params) {
	$table = "t_prod";
	$tprefix = "$table.c_";
	
	//#region 构建sql条件语句
	$sqlwhere = "1=1 ";
	
	if(!isempty($params["name"])){
		$v = str_replace("*", "%", $params["name"]);
		$sqlwhere .= " and {$tprefix}serialnum like '$v' ";
	}
	
	if(!isempty($params["orgid"])){
		$sqlwhere .= " and {$tprefix}orgid = '$params[orgid]' ";
	}
	
	//#endreg 构建sql条件语句
	
	return getcommbc("prod", $params, null, null, $sqlwhere);
}
?>